/**
 * Created by zhangz on 2017/5/31.
 */
import { Component, OnInit } from '@angular/core';
import {Hero} from "../model/hero";
import {HeroService} from "../service/hero.service";


@Component({
  selector: 'my-dashboard',
  templateUrl: '/app/template/hero-dashboard.html',
  styleUrls: [ '/app/style/hero-dashboard.css' ]
})
export class DashboardComponent implements OnInit {

  heroes: Hero[] = [];

  constructor(private heroService: HeroService) { }

  ngOnInit(): void {
    this.heroService.getHeroes()
      .then(heroes => this.heroes = heroes.slice(1, 5));
  }
}
